<div>
    <a href="javascript:void(0);" class="button ui-state-default ui-corner-all" id="addnewwarehouse" onclick="CompanyNewWarehouse();" >
        <span class="ui-icon ui-icon-contact"></span>
        Add warehouse
    </a>
</div>
<br />
<div id="contact_warehouse">
    <?php foreach($models as $i=>$model): ?>
    <div id="warehouse_content" class="ui-widget ui-widget-content ui-corner-all">
        <?php
        $this->widget('application.widgets.iconcontrol.iconcontrol',
            array('icons'=>array(
                    'new_warehouse'=>array('icon'=>'ui-icon-closethick','click'=>'function(){confirmBox("Cant be delete","There is no need to delete this")}','title'=>'Add new warehouse'),
                    ),
            ));
        ?>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,"[$i]pic"); ?>
<?php echo CHtml::activeTextField($model,"[$i]pic",array('size'=>35,'maxlength'=>250)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,"[$i]contact"); ?>
<?php echo CHtml::activeTextField($model,"[$i]contact",array('size'=>35,'maxlength'=>250)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,"[$i]cname"); ?>
<?php echo CHtml::activeTextField($model,"[$i]cname",array('size'=>35,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,"[$i]postal"); ?>
<?php echo CHtml::activeTextField($model,"[$i]postal",array('size'=>35,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,"[$i]address"); ?>
<?php echo CHtml::activeTextArea($model,"[$i]address",array('rows'=>3, 'cols'=>37)); ?>
</div>
    </div>
    <br />
    <?php endforeach; ?>
</div>